package com.zth.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;

import com.github.pagehelper.PageHelper;
import com.zth.mapper.TagMapper;
import com.zth.pojo.Tag;
import com.zth.service.TagService;

@Service
@Transactional
public class TagServiceImpl implements TagService{
	@Autowired
	private TagMapper tagMapper;
	@Override
	public List<Tag> tagAll(Tag tag, int page, int pageSize) {
		PageHelper.startPage(page,pageSize);
		return tagMapper.tagAll(tag);
	}
	@Override
	public int[] tagByName(@RequestParam(name = "name[]")String[] name) {
		return tagMapper.tagByName(name);
	}
	@Override
	public Tag tagById(int tags_id) {
		return tagMapper.tagById(tags_id);
	}
	@Override
	public int add(Tag tag) {
		return tagMapper.add(tag);
	}
	@Override
	public int deleteBatch(int[] ids) {
		return tagMapper.deleteBatch(ids);
	}

}
